<template>
<div class="home">
  <div class="d1">
    <aside>
        
    </aside>
   
   
      <h3>{{username}}</h3>
      <button class="bb1" @click="p1()">【退出登录】</button>
  </div>
  <div class="d2">
    <div class="dd1">
      
       <p class="p0"><router-link to="/home/add">添加人员</router-link></p>
       <p class="p1"><router-link to="/home/per">人员列表</router-link></p>
       <p class="p2"><router-link to="/home/school">高校数据</router-link></p>
       <p class="p2"><router-link to="/home/pro">商品列表</router-link></p>
       <p class="p2"><router-link to="/home/edpro">商品编辑</router-link></p>




        
          
      
     
    </div>
   <article>
        <router-view></router-view>
    </article>
  </div>
  </div>
</template>

<script>
export default {
 name:"HomeCom",
 data(){
    //访问会话存储中存储的登录着账号
    let loginuser=sessionStorage.getItem('islogin')
    return{
       username:loginuser,//在页面渲染前，读取会话存储的数据并赋值
    }
 },
 methods:{
    p1(){
        //清除sessionStorage
        sessionStorage.clear();
        //跳转
        alert('已退出')
         this.$router.push('/login');
    }
 }
}
</script>

<style scoped>
.home{
    height:100%;
    width:100%;
   
}
.imgg{
   width: 100px;
   height: 100px;
} 
.d1{
    height: 100px;
    width: 100%;
    background-color: rgb(67, 209, 245);
    display: flex;
    justify-content:flex-start;
    align-items: center;
}
.d1 aside{
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgb(206,206,206);
    margin-left: 50px;
}
.d1 .bb1{
    border: none;
    background-color: unset;
    padding: 20px 10px;
    box-shadow: 0px 0px 6px;
    border-radius: 5px;
}
.d1 h3{
    color: white;
    margin-left: 25px;
     font-weight: bold;


}
.d1 p{
    color: #7c777b;
    margin-right: 25px;
}
.d2{
    display: flex;
    height: 1000px;
    width: 100%;
    background-color: rgb(255, 255, 255);
   
}
.d2 .dd1{
    width: 15%;
    height: 100%;
   
    background-color: rgb(78, 191, 243);
}

.dd1 .p0,.p1,.p2{
    
   text-align: center;
    color: white;
    font-size: 20px;
    line-height: 40px;
    font-weight: 800;
    
}
.dd1 .router-link-active{
    border-bottom: 2px solid white;
    font-size: 18px;
}
.d2 article{
    width: 85%;
}





</style>